package com.song.service.Impl;

import com.song.dao.RoomMapper;
import com.song.pojo.Room;
import com.song.service.RoomService;
import com.song.vo.RoomVo;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author 宋超
 * HP - the login name of the current user.
 * 2020/12/23 - the current system date.
 * 11:05 - the current system time.
 */
@Service
@Transactional
public class RoomServiceImpl implements RoomService {

    @Resource
    private RoomMapper roomMapper;

    //查询房间列表
    public List<Room> findRoomListByPage(RoomVo roomVo) {
        return roomMapper.findRoomListByPage(roomVo);
    }


    //添加房间
    public int addRoom(Room room) {
        return roomMapper.addRoom(room);
    }

    //修改房间
    public int updateRoom(Room room) {
        return roomMapper.updateRoom(room);
    }


    //删除
    public int deleteById(int id) {
        return roomMapper.deleteById(id);
    }

    //根据楼层查询房间列表
    public List<Room> findRoomListByFloorId() {
        return roomMapper.findRoomListByFloorId();
    }

    //查看房间详情
    public Room findById(Integer id) {
        return roomMapper.findById(id);
    }

}
